
<template class="task-template">
    <section id="project-section" class="section js-section flexlayout">
        <div class="left-games" id="left-games">
            <script id="games" type="text/html">
                {{each list}}
                    {{include 'game-template' $value}}
                {{/each}}
            </script>
            <script id="operation-dropbutton-template" type="text/html">
                <div class="btn-group dropup">
                    <button type="button" class="btn btn-secondary project-operation" style="width:160px" operation="{{operation}}" gameid="{{id}}" projectid="{{main.id}}">{{main.name}}</button>
                    <button type="button" class="btn btn-secondary dropdown-toggle dropdown-toggle-split" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                        <span class="sr-only"></span> 
                    </button>
                    <div class="dropdown-menu">
                        {{each others}}
                            <a class="dropdown-item project-operation" operation="{{operation}}" gameid="{{id}}" projectid="{{$value.id}}">{{$value.name}}</a>
                        {{/each}}
                    </div>
                </div>
            </script>
            <script id="project-dropbutton-template" type="text/html">
                <div class="btn-group dropup">
                    <button type="button" class="btn btn-secondary project-operation" style="width:160px" operation="{{operation}}" gameid="{{id}}" projectid="{{main.id}}">{{main.name}}</button>
                    <button type="button" class="btn btn-secondary dropdown-toggle dropdown-toggle-split" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                        <span class="sr-only"></span> 
                    </button>
                    <ul class="dropdown-menu multi-level" role="menu" aria-labelledby="dropdownMenu">
                        {{each others}}
                            <li class="dropdown-submenu">  
                                <a class="dropdown-item" style="width:160px" >{{$value.name}}</a>  
                                <ul class="dropdown-menu">  
                                    <li style="width:200px" >
                                        <a class="dropdown-item project-operation" operation="1" gameid="{{id}}" projectid="{{$value.id}}">Open With Unity</a>
                                    </li>
                                    <li style="width:200px" >
                                        <a class="dropdown-item project-operation" operation="2" gameid="{{id}}" projectid="{{$value.id}}">Open Containing Folder</a>
                                    </li>
                                </ul>
                            </li> 
                        {{/each}}
                    </ul>
                </div>
            </script>
            <script id="game-template" type="text/html">
                <div class="game-operation">
                    <div class="left" width="400px">
                    <div class="icon">
                        <div class="circle" style="background-color:{{color}}">
                            <p class="shortname" id="{{id}}">{{name}}</p>
                        </div>
                    </div>
                    <div class="more">
                        <div class="fullname">{{name}}</div>
                        <button type="button" class="btn btn-link button-showmore" gameid="{{id}}">Show more</button>
                    </div>
                    </div> 
                    <div class="right">
                        <div class="op">
                            <p>{{develope}}</p>
                            {{include 'project-dropbutton-template' projects}}   
                        </div>
                        <div class="op">				
                            <p>{{wwise}}</p>
                            {{include 'operation-dropbutton-template' wwiseprojects}}
                        </div>
                        <div class="op">				
                            <p>&nbsp;</p>
                            {{include 'operation-dropbutton-template' operations}}
                        </div>
                    </div>
                </div>
            </script>
        </div>
        <div class="right-game-detail" id="right-game-detail">
            <script id="game-detail-template" type="text/html">
                <div class="fullname">{{name}}</div>
                {{include 'project-detail-template' projects.main}}
                {{each projects.others}}
                    {{include 'project-detail-template' $value}}
                {{/each}}
            </script>
            <script id="project-detail-template" type="text/html">
                <div class="project-detail">
                    <div class="project-detail-wrapper">
                        <button class="js-container-target project-detail-toggle-button">{{name}}
                            <div class="project-detail-local u-avoid-clicks">{{local}}</div>
                        </button>
                        <div class="project-detail-box">
                            <div class="project-detail-controls">
                                <div class="propertyitem">
                                    <label class="label">Name:</label>
                                    <input class="name-of-project value" value="{{name}}"></input>
                                </div>
                                <div class="propertyitem">
                                    <label class="label">SourceControl:</label>
                                    <select class="value" selected="{{$value}}">
                                        {{if sourcectrl=='svn'}}
                                        <Option selected="selected">SVN</Option>
                                        {{else}}
                                        <Option>SVN</Option>
                                        {{/if}}
                    
                                        {{if sourcectrl=='git'}}
                                        <Option selected="selected">Git</Option>
                                        {{else}}
                                        <Option>Git</Option>
                                        {{/if}}
                    
                                        {{if sourcectrl=='perforce'}}
                                        <Option selected="selected">Perforce</Option>
                                        {{else}}
                                        <Option>Perforce</Option>
                                        {{/if}}
                                    </select>
                                </div>
                                <div class="propertyitem">
                                    <label class="label">Depot:</label>
                                    <input class="depot-of-project value" value={{depot}}></input>
                                </div>
                                <div class="propertyitem">
                                    <label class="label">Local Path:</label>
                                    <input class="localpath-of-project value" value={{local}}></input>
                                </div>
                                <div class="propertyitem">
                                    <div class="label">
                                        <button type="button" class="delete-project" gameid="{{gameid}}" projectid="{{id}}">删除</button>
                                        <button type="button" class="edit-project" gameid="{{gameid}}" projectid="{{id}}">编辑</button>
                                    </div>
                                    <div class="value" align="right">
                                        <button type="button" class="update-project" gameid="{{gameid}}" projectid="{{id}}">Update</button>
                                        <button type="button" class="revert-project" gameid="{{gameid}}" projectid="{{id}}">Revert</button>
                                        <button type="button" class="commit-project" gameid="{{gameid}}" projectid="{{id}}">Commit</button>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </script>
        </div>
    </section>
</template>

